//	WinPlace.h
//

#ifndef _WINPLACE_H
#define _WINPLACE_H

struct PLACEMENT
{
	int size;
	int active;
	int order;
	CString name;
	CPoint position;
};

struct WinPlace: public tagWINDOWPLACEMENT
{
    WinPlace();
    ~WinPlace();

    void Get(CWnd* pWnd);
    void Set(CWnd* pWnd);

    BOOL Restore(CWnd* pWnd, LPCTSTR regkey, LPCTSTR name, BOOL bChange = FALSE);
    void Save(CWnd* pWnd, LPCTSTR regkey, LPCTSTR name);

	BOOL ParsePlacements(LPTSTR pBuf, int size, CObList* pList);
	LONG SavePlacementList(HKEY hKey, CObList* pList);
	void CalcNewPosition(PLACEMENT* place, int x, int y, BOOL bReplace = TRUE);
	BOOL ActivatePlacement(CObList* placementList, LPCTSTR pName, BOOL bChange);
	void DeactivatePlacement(CObList* placementList, LPCTSTR pName);
	void CleanupPlacementList(CObList* pList);
};

#endif	//ndef _WINPLACE_H
